﻿<Page
    x:Class="GPACalculatorForWindowsStoreApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GPACalculatorForWindowsStoreApp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DataContext="{d:DesignData DesignData/ScoreSample.xaml}" Loaded="Page_Loaded">
    
    <Page.Resources>
        <Style x:Key="GradeButtonStyle" TargetType="Button">
            <Setter Property="FontSize" Value="25" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="Width" Value="90" />
        </Style>
        <Style x:Key="CreditButtonStyle" TargetType="Button">
            <Setter Property="Height" Value="71" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="FontSize" Value="25" />
        </Style>
        
        <DataTemplate x:Key="GradeListViewTemplate">
            <Grid Height="55" Width="411">
                
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding GradeString}" VerticalAlignment="Top" FontSize="40" Margin="10,0,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Credit}" VerticalAlignment="Top" FontSize="40" Margin="80,0,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="credit" VerticalAlignment="Top" FontSize="30" Margin="110,0,0,0"/>
                <Button HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,0,15,0" Width="55" Height="55" BorderThickness="0" Padding="0" Tapped="GradeDeleteButton_Tapped">
                    <Image Source="Images/delete.png" Margin="0" Width="48" Height="48" Stretch="None" />
                </Button>
            </Grid>
        </DataTemplate>
    </Page.Resources>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="35*"/>
    		<RowDefinition Height="349*"/>
    	</Grid.RowDefinitions>
    	<TextBlock HorizontalAlignment="Left" Height="47" Margin="22,19,0,0" TextWrapping="Wrap" Text="GPA Calculator" VerticalAlignment="Top" Width="517" Style="{StaticResource PageHeaderTextStyle}"/>
    	<Grid Margin="10" Grid.Row="1">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="441"/>
    			<ColumnDefinition/>
    			<ColumnDefinition Width="289"/>
    			<ColumnDefinition Width="230"/>
    		</Grid.ColumnDefinitions>
    		<Grid Margin="0">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="115"/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
                
                <TextBlock x:Name="GPATextBlock" HorizontalAlignment="Left" Margin="10,4,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="66.667" FontFamily="Segoe UI" Text="4.30" FontWeight="Light" Foreground="#FFAACCFF" />
                <TextBlock x:Name="TotalCreditTextBlock" HorizontalAlignment="Left" Margin="232,4,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="66.667" FontFamily="Segoe UI" Text="150" FontWeight="Light" Foreground="#FF7799FF" TextAlignment="Right"/>
    			<TextBlock HorizontalAlignment="Left" Margin="39,79,0,0" TextWrapping="Wrap" Text="Grade Point Average" VerticalAlignment="Top" FontSize="16" FontFamily="Segoe WP Semibold"/>
    			<TextBlock HorizontalAlignment="Left" Margin="292,79,0,0" TextWrapping="Wrap" Text="Total Credits" VerticalAlignment="Top" FontSize="16" FontFamily="Segoe WP Semibold"/>

                <ListView x:Name="GradeListView" Margin="10" Grid.Row="1" ItemTemplate="{StaticResource GradeListViewTemplate}" ItemsSource="{Binding Grades}" SelectionMode="None" />
            </Grid>
    		<TextBlock Grid.Column="2" HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Text="Grade" VerticalAlignment="Top" Style="{StaticResource GroupHeaderTextStyle}"/>
    		<TextBlock Grid.Column="3" HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top" Style="{StaticResource GroupHeaderTextStyle}" Text="Credit"/>
    		<StackPanel x:Name="GradeStackPanel" Grid.Column="2" HorizontalAlignment="Left" Margin="10,50,0,10" Width="269">
    			<StackPanel Height="71" Orientation="Horizontal">
    				<Button Content="A+" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="A0" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="A-" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
    			</StackPanel>
    			<StackPanel Height="71" Orientation="Horizontal">
                    <Button Content="B+" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="B0" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="B-" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                </StackPanel>
    			<StackPanel Height="71" Orientation="Horizontal">
                    <Button Content="C+" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="C0" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="C-" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                </StackPanel>
    			<StackPanel Height="71" Orientation="Horizontal">
                    <Button Content="D+" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="D0" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                    <Button Content="D-" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                </StackPanel>
    			<StackPanel Height="71" Orientation="Horizontal">
                    <Button Content="F" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="269" Style="{StaticResource GradeButtonStyle}" Tapped="GradeButton_Tapped"/>
                </StackPanel>
    		</StackPanel>
    		<StackPanel x:Name="CreditStackPanel" Grid.Column="3" Margin="10,50,10,10">
    			<Button Content="6 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="6" Tapped="CreditButton_Tapped"/>
                <Button Content="5 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="5" Tapped="CreditButton_Tapped"/>
                <Button Content="4 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="4" Tapped="CreditButton_Tapped"/>
                <Button Content="3 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="3" Tapped="CreditButton_Tapped"/>
                <Button Content="2 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="2" Tapped="CreditButton_Tapped"/>
                <Button Content="1 credits" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource CreditButtonStyle}" Tag="1" Tapped="CreditButton_Tapped"/>
            </StackPanel>
    	</Grid>
    	<TextBlock HorizontalAlignment="Left" Height="5" Margin="1031,788,-31,-95" Grid.Row="1" Style="{StaticResource PageSubheaderTextStyle}" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="366"/>

    </Grid>
</Page>
